<!---GUI FOR THE SUMMARY REPORT OF APPLICATIONS DURING A CUT-OFF FOR THE EDTR--->
<!---MICO--->
<title>iBOS/e eDTR - Summary Report</title>
<CFSET EDTRCODE = DECRYPT(URL.id,CLIENT.EK)>
<CFSET pid = DECRYPT(URL.pid,CLIENT.EK)>
<CFMODULE template="#CLIENT.COMMON_PATH#cfm_geturlvariables.cfm" REMOVEURL = "t,EDIT,DELETE" >
<CFQUERY NAME="getRECORD" DATASOURCE="#client.company_dsn#">
	SELECT A.TKFILENAME_FK, A.EDTRGROUP, A.SHAREDVIEW, A.SHAREDUPDATE, A.GROUPCODE, 
		B.CUTOFFSTARTDATE, B.CUTOFFENDDATE
	FROM ECRGDTR A, CRGTKFILES B
	WHERE EDTRCODE = '#EDTRCODE#'
		AND A.TKFILENAME_FK = B.TKFILENAME
</CFQUERY>
<CFIF STRUCTKEYEXISTS(URL,"T")>
	<CFSET THETABLE = URL.T>
</CFIF>
<CFPARAM NAME = "THETABLE" DEFAULT = "#GETRECORD.TKFILENAME_FK#PX">
<CFIF getRECORD.RECORDCOUNT>
	<CFSET sTHETK = getRECORD.TKFILENAME_FK>
	<CFSET dCUTOFFSTART = GETRECORD.CUTOFFSTARTDATE>
	<CFSET dCUTOFFEND = GETRECORD.CUTOFFENDDATE>
<CFELSE>
	<TR height="25"></TR>
	<TR><TD><STRONG>No records during the cut-off period</STRONG></TD></TR>
</CFIF>
<CFQUERY NAME = "getRECORDDTL" datasource="#CLIENT.COMPANY_DSN#">
	SELECT FORMCODE_FK, DATEFIELD
	FROM ECRGDTRDTL
	WHERE EDTRCODE = '#EDTRCODE#'
</CFQUERY>
<CFQUERY NAME = "qryEMPDETAILS" datasource="#CLIENT.COMPANY_DSN#">
	SELECT A.UNITCODE, A.PERSONNELBADGENO, A.LASTNAME, A.FIRSTNAME, 	
		A.MIDDLENAME,B.WORKSKEDCODE, C.DESCRIPTION
	FROM CMFPA A, CINWSMASTER B, CLKWORKSKED C
	WHERE A.PERSONNELIDNO = B.PERSONNELIDNO
		AND B.ACTIVESKED = 'Y'
		AND B.WORKSKEDCODE = C.WORKSKEDCODE
		AND A.PERSONNELIDNO = '#PID#'
</CFQUERY>
<CFQUERY name="qryECINDTRUPDATE" datasource="#CLIENT.COMPANY_DSN#">
	SELECT DOCNUMBER,APPROVED
	FROM ECINDTRUPDATE
	WHERE EDTRCODE_FK = '#EDTRCODE#'
		AND PID = '#PID#'
		AND (APPROVED NOT IN ('Y','N','C') OR APPROVED IS NULL)
</CFQUERY>
<CFQUERY NAME = "getEFORMS" datasource="#CLIENT.COMPANY_DSN#">
	SELECT TABLENAME_FK, DESCRIPTION, PREPROCESS,FORMCODE
	FROM ECRGFORMS
	WHERE FORMCODE IN (#QUOTEDVALUELIST(GETRECORDDTL.FORMCODE_FK)#)
</CFQUERY>
<CFLOOP query="getEFORMS">
	<CFIF THETABLE EQ TABLENAME_FK>
		<CFSET THETITLE = DESCRIPTION>
		<CFSET THEPREPROCESS = PREPROCESS>
		<CFSET THEFORMCODE = FORMCODE>
		<CFBREAK>
	</CFIF>
</CFLOOP>
<CFOUTPUT>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH="100%">
<tr>
<CFIF qryECINDTRUPDATE.RECORDCOUNT>
	<CFSET THEDOCNUMBER = qryECINDTRUPDATE.DOCNUMBER>
	<CFIF qryECINDTRUPDATE.APPROVED EQ "">
		<CFSET EDTRROUTED = FALSE>
	<TD>The eDTR Updating Form of #qryEMPDETAILS.LASTNAME#,#qryEMPDETAILS.FIRSTNAME# for this attendance cut-off is not yet routed (DOCNUMBER: #THEDOCNUMBER#)</TD>
	<CFELSE>
		<CFSET EDTRROUTED = TRUE>
	<TD>The eDTR Updating Form of #qryEMPDETAILS.LASTNAME#,#qryEMPDETAILS.FIRSTNAME# for this attendance cut-off is still on-process (DOCNUMBER: #THEDOCNUMBER#)</TD>
	</CFIF>
<CFELSE>
	<CFSET EDTRROUTED = FALSE>
	<TD>The eDTR Updating Form of #qryEMPDETAILS.LASTNAME#,#qryEMPDETAILS.FIRSTNAME# for this attendance cut-off was given the DOCNUMBER: #THEDOCNUMBER#</TD>
</CFIF>
</tr>
</TABLE>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=5 WIDTH="100%">
	<CFOUTPUT>
	<TR VALIGN="bottom">
		<TD ALIGN="right"><IMG SRC="#client.image_path##session.site_ibose#"></TD>
		<TD NOWRAP CLASS="bold14" WIDTH="100%"><FONT FACE="Impact" SIZE="+2">#client.companyname#</FONT><BR>#THETITLE# - SUMMARY</TD>
	</TR>
	</CFOUTPUT>
</TABLE>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH="100%">
	<TR>
		<TD ALIGN="right">iBOS/e eDTR - Updating</TD>
	</TR>
		<TR>
				<TD align="center">
					FROM #DATEFORMAT(dCUTOFFSTART)# TO #DATEFORMAT(dCUTOFFEND)#
				</TD>
			</TR>
			<TR>
				<TD align="left">
					UNIT CODE: #qryEMPDETAILS.UNITCODE#
				</TD>
			</TR>
			<TR>
				<td align="left">
					EMPLOYEE NO.: #PID#
				</td>
			</TR>
			<TR>
				<td align="left">
					BADGE NO.: #qryEMPDETAILS.PERSONNELBADGENO#
				</td>
			</TR>
			<TR>
				<TD align="left">
					EMPLOYEE NAME: #qryEMPDETAILS.LASTNAME#, #qryEMPDETAILS.FIRSTNAME# #qryEMPDETAILS.MIDDLENAME#
				</TD>
			</TR>
			<TR>
				<TD align="left">
					SCHEDULE CODE: #qryEMPDETAILS.WORKSKEDCODE# - #qryEMPDETAILS.DESCRIPTION#
				</TD>
			</TR>
</TABLE>
<CFIF THETABLE NEQ "#GETRECORD.TKFILENAME_FK#PX">
	<CFQUERY NAME = "getDATEFIELD" datasource="#CLIENT.COMPANY_DSN#" maxrows="1">
		SELECT DATEFIELD
		FROM ECRGDTRDTL
		WHERE EDTRCODE = '#EDTRCODE#' AND FORMCODE_FK IN
			(SELECT FORMCODE FROM ECRGFORMS WHERE TABLENAME_FK = '#THETABLE#')
	</CFQUERY>
	<CFQUERY NAME = "getBROWSEFIELDS" datasource="#CLIENT.GLOBAL_DSN#">
		SELECT TABLENAME,COLUMNNAME,COLUMNTYPE,COLUMNDESC,FIELDGROUP,DEFAULTVALUE,COLUMNREQUIRED
		FROM GRGBOSETABLEFIELDS
		WHERE TABLENAME = '#THETABLE#'
			AND ISVISIBLEEFORM = 'Y'
		ORDER BY COLUMNORDER
	</CFQUERY>
	<CFIF STRUCTKEYEXISTS(FORM,"btnSAVENEWAPP")>
		<CFINCLUDE template="func_savenewapp.cfm">
	<CFELSEIF STRUCTKEYEXISTS(URL,"DELETE")>
		<CFQUERY name="delREC" datasource="#CLIENT.COMPANY_DSN#">
			DELETE FROM #THETABLE#
			WHERE DOCNUMBER = '#URL.DELETE#'
				AND PERSONNELIDNO = '#PID#'
		</CFQUERY>
	</CFIF>
	<CFQUERY NAME = "getCONTENTS" datasource="#CLIENT.COMPANY_DSN#">
		SELECT *
		FROM #THETABLE#
		WHERE PERSONNELIDNO = '#PID#' AND
		(<CFLOOP LIST = "#GETDATEFIELD.DATEFIELD#" index="DF">
		(#DF# >= '#dCUTOFFSTART#' AND #DF# <= '#dCUTOFFEND#')
			<CFIF DF NEQ LISTLAST(GETDATEFIELD.DATEFIELD)>OR</CFIF>
		</CFLOOP>)		
	</CFQUERY>
<CFIF not STRUCTKEYEXISTS(FORM,"btnDOWNLOAD")>
	<table border=1 cellspacing=0 cellpadding=1 width="100%">
		<TR height="20"></TR>
		<tr bgcolor="#CLIENT.color_grphead#" valign="top">
			<TD align="center"><strong>STATUS</strong></TD>
			<CFLOOP QUERY ="getBROWSEFIELDS">
			<TD align="center"><strong>#COLUMNDESC#</strong></TD>
			</CFLOOP>
		</TR>
		<CFLOOP query="getCONTENTS">
			<CFSET AROW = CURRENTROW>
			<tr bgcolor="#IIf(CurrentRow Mod 2, "client.color_tblset2", "client.color_tblset1")#" valign="top">
			<CFSWITCH expression="#APPROVED#">
				<CFCASE value="Y">
					<TD align="center">APPROVED</TD>
				</CFCASE>
				<CFCASE value="N">
					<TD align="center">DISAPPROVED</TD>
				</CFCASE>
				<CFCASE value="C">
					<TD align="center">APPROVED</TD>
				</CFCASE>
				<CFCASE value="S">
					<TD align="center">PENDING</TD>
				</CFCASE>
				<CFDEFAULTCASE>
					<TD align="center">NOT YET ROUTED</TD>
				</CFDEFAULTCASE>
			</CFSWITCH>
			<CFLOOP QUERY = "getBROWSEFIELDS">
				<CFIF NOT COLUMNTYPE EQ "ftDateTime">
					<TD align="center">#EVALUATE("GETCONTENTS.#COLUMNNAME#[AROW]")#</TD>
				<CFELSE>
					<TD align="center">#DATEFORMAT(EVALUATE("GETCONTENTS.#COLUMNNAME#[AROW]"))#</TD>
				</CFIF>
			</CFLOOP>
			</TR>
		</CFLOOP>
		<TR height="10"></TR>
		</table>
		<table border=1 cellspacing=0 cellpadding=1 width="100%">
		<tr><td colspan="100">
		<CFFORM name="extract" format="flash" method="post">
			<CFSELECT name="selEXTRACTTYPE">
				<OPTION value="excel"> EXCEL FILE </OPTION>
				<OPTION value="pdf"> PDF FILE </OPTION>
			</CFSELECT>
			<CFGRID name="TEST"> MICO </CFGRID>
			<CFINPUT type="submit" name="btnDOWNLOAD" value="DOWNLOAD REPORT">
		</CFFORM>
		</td></tr>
		</table>
<CFELSEIF FORM.selEXTRACTTYPE EQ "excel">
	<CFSET THEFN = "#REPLACE(THETITLE," ","","ALL")##DATEFORMAT(dCUTOFFSTART)##qryEMPDETAILS.LASTNAME##qryEMPDETAILS.FIRSTNAME#">
	<cfheader name="Content-Disposition" value="attachment; filename=summaryreport.xls">
	<cfcontent type="application/vnd.ms-excel">
	<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=5 WIDTH="100%">
	<CFOUTPUT>
	<TR VALIGN="bottom">
		<TD ALIGN="right"><IMG SRC="#client.image_path##session.site_ibose#"></TD>
		<TD NOWRAP CLASS="bold14" WIDTH="100%"><FONT FACE="Impact" SIZE="+2">#client.companyname#</FONT><BR>#THETITLE# - SUMMARY</TD>
	</TR>
	</CFOUTPUT>
</TABLE>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH="100%">
	<TR>
		<TD ALIGN="right">iBOS/e eDTR - Updating</TD>
	</TR>
		<TR>
				<TD align="center">
					FROM #DATEFORMAT(dCUTOFFSTART)# TO #DATEFORMAT(dCUTOFFEND)#
				</TD>
			</TR>
			<TR>
				<TD align="left">
					UNIT CODE: #qryEMPDETAILS.UNITCODE#
				</TD>
			</TR>
			<TR>
				<td align="left">
					EMPLOYEE NO.: #PID#
				</td>
			</TR>
			<TR>
				<td align="left">
					BADGE NO.: #qryEMPDETAILS.PERSONNELBADGENO#
				</td>
			</TR>
			<TR>
				<TD align="left">
					EMPLOYEE NAME: #qryEMPDETAILS.LASTNAME#, #qryEMPDETAILS.FIRSTNAME# #qryEMPDETAILS.MIDDLENAME#
				</TD>
			</TR>
			<TR>
				<TD align="left">
					SCHEDULE CODE: #qryEMPDETAILS.WORKSKEDCODE# - #qryEMPDETAILS.DESCRIPTION#
				</TD>
			</TR>
</TABLE>
<table border=1 cellspacing=0 cellpadding=1 width="100%">
	<TR height="20"></TR>
	<tr bgcolor="#CLIENT.color_grphead#" valign="top">
		<TD align="center"><strong>STATUS</strong></TD>
		<CFLOOP QUERY ="getBROWSEFIELDS">
		<TD align="center"><strong>#COLUMNDESC#</strong></TD>
		</CFLOOP>
	</TR>
	<CFLOOP query="getCONTENTS">
		<CFSET AROW = CURRENTROW>
		<tr bgcolor="#IIf(CurrentRow Mod 2, "client.color_tblset2", "client.color_tblset1")#" valign="top">
		<CFSWITCH expression="#APPROVED#">
			<CFCASE value="Y">
				<TD align="center">APPROVED</TD>
			</CFCASE>
			<CFCASE value="N">
				<TD align="center">DISAPPROVED</TD>
			</CFCASE>
			<CFCASE value="C">
				<TD align="center">APPROVED</TD>
			</CFCASE>
			<CFCASE value="S">
				<TD align="center">PENDING</TD>
			</CFCASE>
			<CFDEFAULTCASE>
				<TD align="center">NOT YET ROUTED</TD>
			</CFDEFAULTCASE>
		</CFSWITCH>
		<CFLOOP QUERY = "getBROWSEFIELDS">
			<CFIF NOT COLUMNTYPE EQ "ftDateTime">
				<TD align="center">#EVALUATE("GETCONTENTS.#COLUMNNAME#[AROW]")#</TD>
			<CFELSE>
				<TD align="center">#DATEFORMAT(EVALUATE("GETCONTENTS.#COLUMNNAME#[AROW]"))#</TD>
			</CFIF>
		</CFLOOP>
		</TR>
	</CFLOOP>
	<TR height="10"></TR>
	<TR><TD colspan="100" align="center">Summary Report generated by #CLIENT.MYNAME# on #now()#</TD></TR>
	</table>
		</CFCONTENT>
		<table border=1 cellspacing=0 cellpadding=1 width="100%">
		<tr><td colspan="100">
		<CFIF NOT STRUCTKEYEXISTS(FORM,"btnDOWNLOAD")>
		<CFFORM name="extract" format="html" method="post">
			<CFSELECT name="selEXTRACTTYPE">
				<OPTION value="excel"> EXCEL FILE </OPTION>
				<OPTION value="pdf"> PDF FILE </OPTION>
			</CFSELECT>
			<CFINPUT type="submit" name="btnDOWNLOAD" value="DOWNLOAD REPORT">
		</CFFORM>
		</CFIF>
		</td></tr>
		</table>
<CFELSE>
<cfdocument format="pdf">
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=5 WIDTH="100%">
	<CFOUTPUT>
	<TR VALIGN="bottom">
		<TD ALIGN="right"><IMG SRC="#client.image_path##session.site_ibose#"></TD>
		<TD NOWRAP CLASS="bold14" WIDTH="100%"><FONT FACE="Impact" SIZE="+2">#client.companyname#</FONT><BR>#THETITLE# - SUMMARY</TD>
	</TR>
	</CFOUTPUT>
</TABLE>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH="100%">
	<TR>
		<TD ALIGN="right">iBOS/e eDTR - Updating</TD>
	</TR>
		<TR>
				<TD align="center">
					FROM #DATEFORMAT(dCUTOFFSTART)# TO #DATEFORMAT(dCUTOFFEND)#
				</TD>
			</TR>
			<TR>
				<TD align="left">
					UNIT CODE: #qryEMPDETAILS.UNITCODE#
				</TD>
			</TR>
			<TR>
				<td align="left">
					EMPLOYEE NO.: #PID#
				</td>
			</TR>
			<TR>
				<td align="left">
					BADGE NO.: #qryEMPDETAILS.PERSONNELBADGENO#
				</td>
			</TR>
			<TR>
				<TD align="left">
					EMPLOYEE NAME: #qryEMPDETAILS.LASTNAME#, #qryEMPDETAILS.FIRSTNAME# #qryEMPDETAILS.MIDDLENAME#
				</TD>
			</TR>
			<TR>
				<TD align="left">
					SCHEDULE CODE: #qryEMPDETAILS.WORKSKEDCODE# - #qryEMPDETAILS.DESCRIPTION#
				</TD>
			</TR>
</TABLE>
<table border=1 cellspacing=0 cellpadding=1 width="100%">
	<TR height="20"></TR>
	<tr bgcolor="#CLIENT.color_grphead#" valign="top">
		<TD align="center"><strong>STATUS</strong></TD>
		<CFLOOP QUERY ="getBROWSEFIELDS">
		<TD align="center"><strong>#COLUMNDESC#</strong></TD>
		</CFLOOP>
	</TR>
	<CFLOOP query="getCONTENTS">
		<CFSET AROW = CURRENTROW>
		<tr bgcolor="#IIf(CurrentRow Mod 2, "client.color_tblset2", "client.color_tblset1")#" valign="top">
		<CFSWITCH expression="#APPROVED#">
			<CFCASE value="Y">
				<TD align="center">APPROVED</TD>
			</CFCASE>
			<CFCASE value="N">
				<TD align="center">DISAPPROVED</TD>
			</CFCASE>
			<CFCASE value="C">
				<TD align="center">APPROVED</TD>
			</CFCASE>
			<CFCASE value="S">
				<TD align="center">PENDING</TD>
			</CFCASE>
			<CFDEFAULTCASE>
				<TD align="center">NOT YET ROUTED</TD>
			</CFDEFAULTCASE>
		</CFSWITCH>
		<CFLOOP QUERY = "getBROWSEFIELDS">
			<CFIF NOT COLUMNTYPE EQ "ftDateTime">
				<TD align="center">#EVALUATE("GETCONTENTS.#COLUMNNAME#[AROW]")#</TD>
			<CFELSE>
				<TD align="center">#DATEFORMAT(EVALUATE("GETCONTENTS.#COLUMNNAME#[AROW]"))#</TD>
			</CFIF>
		</CFLOOP>
		</TR>
	</CFLOOP>
	<TR height="10"></TR>
	<TR><TD colspan="100" align="center">Summary Report generated by #CLIENT.MYNAME# on #dateformat(now())# #timeformat(now())#</TD></TR>
	</table>
	</CFDOCUMENT>
	<table border=1 cellspacing=0 cellpadding=1 width="100%">
	<tr><td colspan="100">
	<CFFORM name="extract" format="html" method="post">
		<CFSELECT name="selEXTRACTTYPE">
			<OPTION value="excel"> EXCEL FILE </OPTION>
			<OPTION value="pdf"> PDF FILE </OPTION>
		</CFSELECT>
	</CFFORM>
	</td></tr>
	</table>
</CFIF>
</CFIF>
</CFOUTPUT>